//
//  HEAIEndNoticeCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/23.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEAIEndNoticeCell.h"

@interface HEAIEndNoticeCell ()

@property (nonatomic, strong) UILabel *endTopLb;
@property (nonatomic, strong) UILabel *noticeLb;

@end

@implementation HEAIEndNoticeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = CViewBgColor;
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _endTopLb = [UILabel new];
    _endTopLb.text = @"--- 已结束疾病自诊 ---";
    _endTopLb.font = DYFont(15);
    _endTopLb.textColor = CNavDargGrayColor;
    _endTopLb.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview: _endTopLb];
    
    _noticeLb = [UILabel new];
    _noticeLb.text = @"为您提供以下服务";
    _noticeLb.font = DYFont(17);
    _noticeLb.textColor = CNavDargGrayColor;
    _noticeLb.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview: _noticeLb];
    
    
    UIView *warp = [UIView new];
    warp.backgroundColor = KHexColor(@"EBF3FE");
    [self.contentView addSubview:warp];
    warp.layer.masksToBounds = YES;
    warp.layer.cornerRadius = 10;

    UIImageView *leftImgView = [UIImageView new];
    leftImgView.contentMode = UIViewContentModeScaleAspectFill;
    leftImgView.image = IMAGE_NAMED(@"service_suggest_icon");
    [warp addSubview:leftImgView];
    
    UILabel *qesTitleLb = [UILabel new];
    qesTitleLb.text = @"快速提问";
    qesTitleLb.font = DYBlodFont(17);
    qesTitleLb.textColor = CNavLightBlackColor;
    [warp addSubview: qesTitleLb];
    
    UILabel *qesSubTitleLb = [UILabel new];
    qesSubTitleLb.text = @"一次付费，3~5名三甲专家回复，把关病情和诊疗方案，更全面更放心";
    qesSubTitleLb.font = DYFont(16);
    qesSubTitleLb.textColor = CNavBgColor;
    qesSubTitleLb.numberOfLines = 0;
    [warp addSubview: qesSubTitleLb];
 
    
    [_endTopLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(30);
        make.left.right.equalTo(self.contentView);
    }];
    
    [_noticeLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_endTopLb.mas_bottom).offset(20);
        make.left.right.equalTo(self.contentView);
    }];
    
    [warp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_noticeLb.mas_bottom).offset(20);
        make.left.equalTo(self.contentView).offset(50 + 5);
        make.right.equalTo(self.contentView).offset(- (50 + 5));
        make.bottom.equalTo(self.contentView).offset(-15);
    }];
    
    [leftImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(warp).offset(10);
        make.left.equalTo(warp).offset(10);
        make.width.height.offset(27);
    }];
    
    [qesTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(leftImgView);
        make.left.equalTo(leftImgView.mas_right).offset(10);
        make.right.equalTo(warp).offset(-10);
    }];
    
    [qesSubTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(qesTitleLb.mas_bottom).offset(10);
        make.left.equalTo(leftImgView.mas_right).offset(10);
        make.right.equalTo(warp).offset(-10);
        make.bottom.equalTo(warp).offset(-10);
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
